<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->

<!-- Measures Summary -->
<ng-form name="forms.model_measure_form" novalidate>
<div class="dataTables_wrapper form-inline no-footer">

    <table ng-if="state.mode=='view'&&modelsManager.selectedModel.metrics.length > 0" class="table table-striped table-hover">
        <thead>
            <tr>
                <th>ID</th>
                <th>Column</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="measure in modelsManager.selectedModel.metrics track by $index">
                <td>
                    <!--ID -->
                    <b>{{$index + 1}}</b>
                </td>
                <td>
                    <!--Name -->
                    <span tooltip="measure name..">{{measure}}</span>
                </td>
            </tr>
        </tbody>
    </table>
    <div  ng-if="state.mode=='edit'" class="form-group" style="width: 100%">
        <h4 style="margin-left:42px">Select measure columns</h4>
      <ui-select
        close-on-select="false"
        ng-if="state.mode=='edit'"
        style="width: 100%"
        autofocus="true"
        ng-model="modelsManager.selectedModel.metrics" multiple>
        <ui-select-match placeholder="Select Column...">{{$item.name}}</ui-select-match>
          <ui-select-choices
            repeat="measure.name as measure in getColumnsByTable(modelsManager.selectedModel.fact_table) | filter:$select.search">
            {{measure.name}}
          </ui-select-choices>
      </ui-select>

    </div>
</div>

</ng-form>
